package com.hushao.aimi.bo;

import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;
import java.sql.Timestamp;

/**
 * @description: 用户Bo
 * @author: 胡少
 * @create: 2018-06-17 15:01
 **/
@Data
@Slf4j
public class UserBo implements Serializable {
    private String id;
    private String username;
    private String phone;
    private String email;
    private byte status;
    private Integer roleId;
    private Timestamp createTime;
    private Timestamp updateTime;

    protected UserBo(){}
    public UserBo(String id, String username, String phone, String email, byte status, Integer roleId, Timestamp createTime, Timestamp updateTime) {
        this.id = id;
        this.username = username;
        this.phone = phone;
        this.email = email;
        this.status = status;
        this.roleId = roleId;
        this.createTime = createTime;
        this.updateTime = updateTime;
    }
    public UserBo(Object object) {
        try{
            Object[] row= (Object[]) object;
            this.id = (String) row[0];
            this.username = (String) row[1];
            this.phone = (String) row[2];
            this.email = (String) row[3];
            this.status = (byte) row[4];
            this.roleId = (Integer) row[5];
            this.createTime = (Timestamp) row[6];
            this.updateTime = (Timestamp) row[7];
        }catch (Exception e){log.error("转换错误");}

    }
}
